<HTML>
<HEAD>
<LINK REL="stylesheet" HREF="style.css" TYPE="text/css">
<TITLE>slurm.jcf</TITLE>
</HEAD>
<BODY>
<H2>Slurm batch file for LPJmL</H2>
This is a sample <A HREF="https://slurm.schedmd.com/">SLURM</A> batch file for LPJmL. User must be replaced by your user name.

<pre class="tree">
#!/bin/bash 
###############################################################################
##                                                                           ##
##                     s  l  u  r  m  .  j  c  f                             ##
##                                                                           ##
##  SLURM JCF file for running an Intel MPI job on the HLRS2015 cluster      ##
##  at PIK                                                                   ##
##                                                                           ##
###############################################################################
 
#SBATCH --ntasks=256
#SBATCH --qos=short
#SBATCH -J LPJmL40
#SBATCH --signal=15@120
#SBATCH --comment="LPJmL Version 4.0.002"
#SBATCH --mail-user=user
#SBATCH --mail-type=end

#SBATCH -o  lpjml.%j.out
#SBATCH -e  lpjml.%j.err

module load mpi/intel/5.1.3

# set root, restart and output directory for LPJmL

export LPJROOT=/home/user/lpjml
export LPJOUTPATH=/p/tmp/user/lpjml
export LPJRESTARTPATH=/p/tmp/user/lpjml

# create restart and output directory

mkdir -p $LPJOUTPATH/output
mkdir -p $LPJRESTARTPATH/restart

export I_MPI_PMI_LIBRARY=/p/system/slurm/lib/libpmi.so
ulimit -c unlimited

# run LPJmL for spinup and transient

if srun $LPJROOT/bin/lpjml lpjml.js
then
  srun --propagate $LPJROOT/bin/lpjml -DFROM_RESTART lpjml.js
fi
rc=$?  # save return code of srun

# copy log of LPJmL run to output directory

cp lpjml.$SLURM_JOB_ID.out $LPJOUTPATH/output
cp lpjml.$SLURM_JOB_ID.err $LPJOUTPATH/output

exit $rc # exit with return code
</pre>
</body>
Job can be submitted by invoking the following command:
<pre class="example">
% sbatch slurm.jcf
</pre>
